package com.lidong.lowcode.model.manager;

import com.lidong.lowcode.model.datasource.intf.DataSourceModel;
import com.lidong.toolkit.constant.LogConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 4/30/2022 1:25 PM
 */
@Configuration
public class DataSourceManager implements InitializingBean {

    private static final Logger logger = LoggerFactory.getLogger(DataSourceManager.class);

    public static List<DataSourceModel> dataSourceModel;

    @Autowired(required = false)
    private List<DataSourceModel> dataSourceModels;

    @Override
    public void afterPropertiesSet() {
        logger.info(LogConst.LOG_SUCCESS_PREFIX+"lowcode-model 数据源模型注册");
        dataSourceModel = dataSourceModels;
    }

}
